Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show unanswered questions to the users on product page. #922

Merged
merged 11 commits into from
Jan 12, 2022

Conversation

jasmeet0817
Copy link
Contributor

  • Provide a path to sign in if they answer and aren't signed in yet.

TODO -

  • Save answer
  • Show a button leaderboard
  • Create a leaderboard

Outputs ->

Small screen:
qcard2

Large screen:
qcard1

Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jasmeet0817 jasmeet0817 merged commit dc66fec into openfoodfacts:develop Jan 12, 2022
Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, it was actually reviewing it when you merged it. Didn't finish.
Feel free to read my unfinished comments ;)

@@ -20,20 +20,22 @@ class SmoothCard extends StatelessWidget {
bottom: VERY_SMALL_SPACE,
),
this.padding = const EdgeInsets.all(5.0),
this.elevation = 8,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about SMALL_SPACE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, but I feel like elevation is not "Space" so I think it doesn't fit.

Comment on lines +391 to +392
final List<RobotoffQuestion> questions =
snapshot.data ?? <RobotoffQuestion>[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a CircularProgressIndicator while waiting?
What if an error occurs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a tiny widget embedded inside the summary card, I don't think the circular progress indicator makes sense (the user won't know what it's for), if there's an error we just won't show the question prompt. The user still sees the product as they would before this change

final RobotoffQuestionResult result =
await OpenFoodAPIClient.getRobotoffQuestionsForProduct(
barcode,
ProductQuery.getLanguage().code,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @M123-dev That's typically something we need to address in off-dart v2.0.0: always use language instead of language.code

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasmeet0817
Copy link
Contributor Author

Oops, it was actually reviewing it when you merged it. Didn't finish. Feel free to read my unfinished comments ;)

woops, sorry, feel free to do a full review, I can make any requested changes.

jasmeet0817 pushed a commit to jasmeet0817/smooth-app that referenced this pull request Jan 12, 2022
jasmeet0817 pushed a commit to jasmeet0817/smooth-app that referenced this pull request Jan 12, 2022
@jasmeet0817
Copy link
Contributor Author

#925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants